#ifndef METADATA_H_
#define METADATA_H_

#include <qstring.h>
#include <qstringlist.h>
#include <qptrlist.h>
#include <qmap.h>
#include <qthread.h>

#include <mythtv/uitypes.h>

class Metadata
{
  public:
    Metadata(QString lfilename = "", QString lartist = "", QString lcompilation_artist = "", 
             QString lalbum = "", QString ltitle = "", QString lgenre = "",
             int lyear = 0, int ltracknum = 0, int llength = 0)
            {
                filename = lfilename;
                artist = lartist;
                compilation_artist = lcompilation_artist;
                album = lalbum;
                title = ltitle;
                genre = lgenre;
                year = lyear;
                tracknum = ltracknum;
                length = llength;
            }

    QString Artist() { return artist; }
    void setArtist(const QString &lartist) { artist = lartist; }
    
    QString CompilationArtist() { return compilation_artist; }
    void setCompilationArtist(const QString &lcompilation_artist) { compilation_artist = lcompilation_artist; }
    
    QString Album() { return album; }
    void setAlbum(const QString &lalbum) { album = lalbum; }

    QString Title() { return title; }
    void setTitle(const QString &ltitle) { title = ltitle; }

    QString FormatArtist();
    QString FormatTitle();

    QString Genre() { return genre; }
    void setGenre(const QString &lgenre) { genre = lgenre; }

    int Year() { return year; }
    void setYear(int lyear) { year = lyear; }
 
    int Track() { return tracknum; }
    void setTrack(int ltrack) { tracknum = ltrack; }

    int Length() { return length; }
    void setLength(int llength) { length = llength; }

    QString Filename() const { return filename; }
    void setFilename(QString &lfilename) { filename = lfilename; }
    
    bool isVisible() { return show; }
    void setVisible(bool visible) { show = visible; }

    // track is part of a compilation album
    bool Compilation() { return compilation; }
    void setCompilation(bool state) { compilation = state; }
    bool determineIfCompilation(bool cd = false);

    bool hasChanged(){return changed;}

  private:
//    void setCompilationFormatting(bool cd = false);

    QString artist;
    QString compilation_artist;
    QString album;
    QString title;
    QString genre;
    int year;
    int tracknum;
    int length;
    bool compilation;
     
    unsigned int id;
    QString filename;
    bool    changed;

    bool    show;
};

#endif
